package xyz.zyt123.hikvideo.config;

import jakarta.servlet.Filter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xyz.zyt123.hikvideo.filter.JwtAuthenticationFilter;

@Configuration
public class WebFilterConfig {

    @Bean
    public FilterRegistrationBean<Filter> filterRegistrationBean(){
        FilterRegistrationBean<Filter> filter = new FilterRegistrationBean<>();
        filter.setFilter(new JwtAuthenticationFilter());
        filter.addUrlPatterns("/*");
        return filter;
    }
}
